To use a kTweenTypePathToMatrixTranslationAndRotation tween component, do the following:
Listing 16 shows how to create a kTweenTypePathToMatrixTranslationAndRotation tween.
Listing 16 Creating a kTweenTypePathToMatrixTranslationAndRotation tween container
err = CreateSamplePathTweenContainer( container,
kTweenTypePathToMatrixTranslationAndRotation,
1, false, duration, X2Fix(0.5), &tweenAtom );
if ( err ) goto bail;
err = QTNewTween( &tween, container, tweenAtom, duration );
if ( err ) goto bail;
for ( tweenTime = 0; tweenTime <= duration; tweenTime++ ) {
MatrixRecord absoluteMatrix;
err = QTDoTween( tween, tweenTime, result, nil, nil, nil );
if ( err ) goto bail;
absoluteMatrix = *(MatrixRecord *)*result;
}
err = QTDisposeTween( tween );
bail:
if ( container ) QTDisposeAtomContainer( container );
if ( result ) DisposeHandle( result );
| Previous | Chapter Contents | Chapter Top | Next |